// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) Huawei Technologies Co., Ltd. 2023-2023. All rights reserved.
 * Author: Huawei OS Kernel Lab
 * Create: Thu Aug 15 16:14:23 2023
 */

#include <linux/err.h>
#include <linux/errno.h>
#include <liblinux/unimpl.h>

/* aio.c */
LIBLINUX_EXPORTED_UNIMPL(kiocb_set_cancel_fn);

/* eventfd.c */
LIBLINUX_GPL_EXPORTED_UNIMPL(eventfd_ctx_put);
LIBLINUX_GPL_EXPORTED_UNIMPL_RET(eventfd_ctx_fdget, void *, ERR_PTR(-ENOSYS));
LIBLINUX_GPL_EXPORTED_UNIMPL_RET(eventfd_signal, __u64, 0);

/* fcntl.c */
LIBLINUX_EXPORTED_UNIMPL_RET(fasync_helper, int, -1);
LIBLINUX_EXPORTED_UNIMPL(kill_fasync);

LIBLINUX_EXPORTED_UNIMPL_RET(vfs_stat, int, 0);

/* fs/configfs/item.c */
LIBLINUX_EXPORTED_UNIMPL(config_group_init);
LIBLINUX_EXPORTED_UNIMPL(config_group_init_type_name);
LIBLINUX_EXPORTED_UNIMPL_RET(config_item_set_name, int, 0);
LIBLINUX_EXPORTED_UNIMPL(config_item_init_type_name);
LIBLINUX_EXPORTED_UNIMPL(config_item_put);

/* fs/configfs/dir.c */
LIBLINUX_EXPORTED_UNIMPL(configfs_unregister_subsystem);
LIBLINUX_EXPORTED_UNIMPL_RET(configfs_register_subsystem, int, 0);

/* fs syscall */

LIBLINUX_EXPORTED_UNIMPL(fence_init);
LIBLINUX_EXPORTED_UNIMPL(fence_release);
LIBLINUX_EXPORTED_UNIMPL_RET(fence_signal_locked, int, 0);
LIBLINUX_EXPORTED_UNIMPL_RET(fence_default_wait, int, 0);
LIBLINUX_EXPORTED_UNIMPL_RET(fence_context_alloc, int, 0);
LIBLINUX_EXPORTED_UNIMPL_RET(fence_wait_timeout, int, 0);
LIBLINUX_EXPORTED_UNIMPL_RET(sync_file_get_fence, int, 0);
LIBLINUX_EXPORTED_UNIMPL_RET(sync_file_create, int, 0);
LIBLINUX_EXPORTED_UNIMPL_RET(ion_import_dma_buf_fd, int, 0);
LIBLINUX_EXPORTED_UNIMPL_RET(dma_buf_attach, int, 0);
LIBLINUX_EXPORTED_UNIMPL(dma_buf_detach);
LIBLINUX_EXPORTED_UNIMPL(ion_unmap_kernel);
LIBLINUX_EXPORTED_UNIMPL(ion_unmap_iommu);
LIBLINUX_EXPORTED_UNIMPL_RET(ion_share_dma_buf_fd, int, 0);
LIBLINUX_EXPORTED_UNIMPL(dma_buf_unmap_attachment);
LIBLINUX_EXPORTED_UNIMPL_RET(dma_buf_get, int, 0);
LIBLINUX_EXPORTED_UNIMPL(dma_buf_put);
LIBLINUX_EXPORTED_UNIMPL_RET(dma_buf_map_attachment, int, 0);
LIBLINUX_EXPORTED_UNIMPL_RET(ion_import_dma_buf, int, 0);
LIBLINUX_EXPORTED_UNIMPL(ion_client_destroy);
LIBLINUX_EXPORTED_UNIMPL_RET(ion_phys, int, 0);

/* fs/file.c */
LIBLINUX_EXPORTED_UNIMPL_RET(__close_range, int, -1);
LIBLINUX_EXPORTED_UNIMPL(set_close_on_exec);
LIBLINUX_UNIMPL_RET(__fdget_raw, unsigned long, 0);
LIBLINUX_UNIMPL_RET(__fdget_pos, unsigned long, 0);
LIBLINUX_UNIMPL(__f_unlock_pos);
LIBLINUX_UNIMPL_RET(__receive_fd, int, 0);
LIBLINUX_UNIMPL_RET(__get_unused_fd_flags, int, 0);

LIBLINUX_EXPORTED_UNIMPL(__f_setown);

/* fs/pnode.c */
LIBLINUX_UNIMPL(change_mnt_propagation);
LIBLINUX_UNIMPL(propagate_mount_unlock);
LIBLINUX_UNIMPL_RET(propagate_mnt, int, 0);
LIBLINUX_UNIMPL_RET(propagate_umount, int, 0);
LIBLINUX_UNIMPL_RET(propagate_mount_busy, int, 0);

/* fs/proc/self.c thread_self.c base.c */
LIBLINUX_UNIMPL_RET(proc_setup_self, int, 0);
LIBLINUX_UNIMPL_RET(proc_setup_thread_self, int, 0);
LIBLINUX_UNIMPL_RET(proc_pid_lookup, long, -1);
LIBLINUX_UNIMPL_RET(proc_pid_readdir, int, 0);

/* fs/splice.c */
LIBLINUX_EXPORTED_UNIMPL_RET(iter_file_splice_write, int, 0);
LIBLINUX_EXPORTED_UNIMPL_RET(generic_file_splice_read, int, 0);
LIBLINUX_UNIMPL_RET(do_splice_direct, long, -ENOSYS);
LIBLINUX_EXPORTED_UNIMPL_RET(generic_splice_sendpage, long, -ENOSYS);
LIBLINUX_UNIMPL_RET(splice_grow_spd, int, 0);
LIBLINUX_UNIMPL(splice_shrink_spd);
LIBLINUX_GPL_EXPORTED_UNIMPL_RET(splice_to_pipe, long, -ENOSYS);
LIBLINUX_UNIMPL_RET(splice_from_pipe, ssize_t, -ENOSYS);

/* crypto/api.c */
#ifndef CONFIG_CRYPTO
LIBLINUX_EXPORTED_UNIMPL_RET(crypto_alloc_base, void *, ERR_PTR(-ENOSYS));
LIBLINUX_EXPORTED_UNIMPL(crypto_destroy_tfm);
#endif

/* fs/remap_range.c */
LIBLINUX_EXPORTED_UNIMPL_RET(vfs_clone_file_range, loff_t, -1);
LIBLINUX_EXPORTED_UNIMPL_RET(vfs_dedupe_file_range, int, -1);

/* lib/usercopy.c */
LIBLINUX_EXPORTED_UNIMPL_RET(check_zeroed_user, int, -1);

/* fs/direct-io.c */
LIBLINUX_EXPORTED_UNIMPL_RET(sb_init_dio_done_wq, int, -1);
#ifdef CONFIG_LIBLINUX_FILES_MODULE
EX_SYMBOL(vfs_read);
EX_SYMBOL(vfs_write);
#endif

/* fs/kernel_read_file.c */
LIBLINUX_UNIMPL_RET(kernel_read_file_from_path_initns, int, -1);

/* fs/proc/base.c */
LIBLINUX_UNIMPL(proc_pid_evict_inode);

/* fs/utimes.c */
LIBLINUX_UNIMPL_RET(vfs_utimes, int, -1);

/* fs/select.c */
LIBLINUX_UNIMPL_RET(poll_select_set_timeout, int, 0);

/* fs/proc/proc_net.c */
LIBLINUX_EXPORTED_UNIMPL_RET(proc_create_net_data, void *, 0);
